package com.whcoding.multithreading.controller;

import cn.hutool.core.util.StrUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;


/**
 * @author Manager
 */
@RestController
@RequestMapping("/hello")
public class HelloWorldController {
	private static final Logger log = LoggerFactory.getLogger(HelloWorldController.class);

	/**
	 * Hello，World
	 * http://localhost:9310/hello?name=111
	 * <p>
	 * localhost:9310/hello
	 *
	 * @param name 参数，非必须
	 * @return Hello, ${who}
	 */
	@GetMapping("/hello")
	public String sayHello(@RequestParam(required = false, name = "name") String name) {
		if (StrUtil.isBlank(name)) {
			name = "whcoding";
		}
		return StrUtil.format("Hello World, {}!", name);
	}


}
